package com.ruoyi.customer.service.impl;

import com.ruoyi.customer.domain.CustomerFinance;
import com.ruoyi.customer.mapper.CustomerFinanceMapper;
import com.ruoyi.customer.service.ICustomerFinanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.validation.Validator;
import java.math.BigDecimal;
import java.util.List;

/**
 * 用户财务 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class CustomerFinanceServiceImpl implements ICustomerFinanceService
{

    @Autowired
    private CustomerFinanceMapper customerFinanceMapper;

    @Autowired
    protected Validator validator;

    /**
     * 根据条件分页查询用户财务列表
     * 
     * @param customerFinance 用户财务信息
     * @return 用户财务信息集合信息
     */
    @Override
    public List<CustomerFinance> selectCustomerFinanceList(CustomerFinance customerFinance)
    {
        return customerFinanceMapper.selectCustomerFinanceList(customerFinance);
    }

    /**
     * 新增保存用户财务信息
     * 
     * @param customerFinance 用户财务信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertCustomerFinance(CustomerFinance customerFinance)
    {
        // 新增用户财务信息
        int rows = customerFinanceMapper.insertCustomerFinance(customerFinance);
        return rows;
    }
}
